package com.hit.aircraftwar.dao;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author LiuYuZhe
 */
public class Record implements Serializable {

    private final int score;
    private final String id;
    private final String timeInfo;

    public Record(int score, String id) {
        this.score = score;
        this.id = id;
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        this.timeInfo = formatter.format(date);
    }

    public Record(String id, int score, String timeInfo) {
        this.score = score;
        this.id = id;
        this.timeInfo = timeInfo;
    }

    public int getScore() {
        return score;
    }

    public String getTimeInfo() {
        return timeInfo;
    }

    public String getId() {
        return id;
    }

    @Override
    public String toString() {
        return (id + "," + score + "," + timeInfo);
    }
}
